#!/sbin/openrc-run
supervisor=supervise-daemon

name="ma1sd"
description="Daemon for ma1sd, the federated Matrix identity server"

: ${command_user:="ma1sd:ma1sd"}
: ${config:="/etc/ma1sd/ma1sd.yaml"}

command="/usr/bin/ma1sd"
command_args="-c $config $command_args"

depends() {
	need net
}

start_pre() {
	# /var/lib/ma1sd needs to be owned by the ma1sd user
	checkpath --directory --owner "$command_user" /var/lib/ma1sd
}
